<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
<head>
    <?php
    if (!empty($this->pageDescription)) {echo '<meta name="description" content="'.$this->pageDescription.'" />';}
    if (!empty($this->pageKeywords)) {echo '<meta name="keywords" content="'.$this->pageKeywords.'" />';}
    if (!empty($this->pageTitle)) {echo '<title>'.$this->pageTitle.'</title>';}
    ?>
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
    <meta name="language" content="en" />

    <!-- blueprint CSS framework -->
    <link rel="stylesheet" type="text/css" href="<?php echo Yii::app()->request->baseUrl; ?>/css/backend/screen.css" media="screen, projection" />
    <link rel="stylesheet" type="text/css" href="<?php echo Yii::app()->request->baseUrl; ?>/css/backend/print.css" media="print" />
    <!--[if lt IE 8]>
    <link rel="stylesheet" type="text/css" href="<?php echo Yii::app()->request->baseUrl; ?>/css/backend/ie.css" media="screen, projection" />
    <![endif]-->

    <link rel="stylesheet" type="text/css" href="<?php echo Yii::app()->request->baseUrl; ?>/css/backend/main.css" />
    <link rel="stylesheet" type="text/css" href="<?php echo Yii::app()->request->baseUrl; ?>/css/backend/form.css" />
    <link rel="stylesheet" type="text/css" href="<?php echo Yii::app()->request->baseUrl; ?>/css/backend/table.css" />
</head>

<body>

<div class="container" id="page">
    <?php if (!(Yii::app()->user->isGuest)) { ?>
    <div class="synchronization_info">
        <?php echo CHtml::link('Выход ('.Yii::app()->user->email.')', Yii::app()->createUrl("/backendsite/logout")); ?>
    </div>
    <?php }; ?>
    <div id="header">
        <div id="logo"><?php echo CHtml::encode(Yii::app()->name); ?></div>
    </div><!-- header -->

    <div id="mainmenu">
        <? //if (Yii::app()->user->isGuest) echo 'guest'; else echo 'auth';?>
        <?php $this->widget('zii.widgets.CMenu',array(
        'items'=>array(
            array('label'=>'Авторизация', 'url'=>array('/backendsite/login'), 'visible'=>Yii::app()->user->isGuest),
            array('label'=>'Датасервера', 'url'=>array('/dataserver/info'), 'visible'=>Yii::app()->user->checkAccess('dataserver/info') || Yii::app()->user->checkAccess('remotedl/info') || Yii::app()->user->checkAccess('controlparser/info'),
                'items'=>array(
                    array('label'=>'Общая информация', 'url'=>array('/dataserver/info'), 'visible'=>Yii::app()->user->checkAccess('dataserver/info')),
                    array('label'=>'Удаленная закачка', 'url'=>array('/remotedl/info'), 'visible'=>Yii::app()->user->checkAccess('remotedl/info')),
                    array('label'=>'Мониторинг парсеров', 'url'=>array('/controlparser/info'), 'visible'=>Yii::app()->user->checkAccess('controlparser/info')),
                )),
            array('label'=>'Статистика', 'url'=>array('/stat/StatFiles'), 'visible'=>Yii::app()->user->checkAccess('stat/StatFiles') || Yii::app()->user->checkAccess('stat/StatUsers') || Yii::app()->user->checkAccess('stat/StatSaleDiagram') || Yii::app()->user->checkAccess('stat/sms') || Yii::app()->user->checkAccess('stat/webmoney') || Yii::app()->user->checkAccess('stat/robokassa') || Yii::app()->user->checkAccess('stat/plimus') || Yii::app()->user->checkAccess('stat/paypal'),
                'items'=>array(
                    array('label'=>'Главная', 'url'=>array('/stat/StatFiles'), 'visible'=>Yii::app()->user->checkAccess('stat/StatFiles')),
                    /*array('label'=>'по закачкам', 'url'=>array('/Stat/StatDownload')),
                    array('label'=>'по закачкам по странам', 'url'=>array('/Stat/StatDownloadCountry')),
                    array('label'=>'по продажам', 'url'=>array('/Stat/StatSale')),
                    array('label'=>'по продажам по странам', 'url'=>array('/Stat/StatSaleCountry')),
                    array('label'=>'по HttpReferrer', 'url'=>array('/Stat/StatHttpReferrer')),*/
                    array('label' => 'по пользователям', 'url' => array('/stat/StatUsers'), 'visible'=>Yii::app()->user->checkAccess('stat/StatUsers')),
                    array('label' => 'по продажам диаграмма', 'url' => array('/stat/StatSaleDiagram'), 'visible'=>Yii::app()->user->checkAccess('stat/StatSaleDiagram')),
                    array('label' => 'по SMS', 'url' => array('stat/sms'), 'visible'=>Yii::app()->user->checkAccess('stat/sms')),
                    array('label' => 'по Webmoney', 'url' => array('stat/webmoney'), 'visible'=>Yii::app()->user->checkAccess('stat/webmoney')),
                    array('label' => 'по Robokassa', 'url' => array('stat/robokassa'), 'visible'=>Yii::app()->user->checkAccess('stat/robokassa')),
                    array('label' => 'по Plimus', 'url' => array('stat/plimus'), 'visible'=>Yii::app()->user->checkAccess('stat/plimus')),
                    array('label' => 'по PayPal', 'url' => array('stat/paypal'), 'visible'=>Yii::app()->user->checkAccess('stat/paypal')),
                )),
            array('label' => 'Пользователи', 'url'=>array('/user/UserList'), 'visible'=>Yii::app()->user->checkAccess('user/UserList') || Yii::app()->user->checkAccess('user/UserListAdvert') || Yii::app()->user->checkAccess('user/UserListUser') || Yii::app()->user->checkAccess('user/UserList') || Yii::app()->user->checkAccess('user/UserAdd'),
                'items'=>array(
                    array('label'=>'Адверты', 'url'=>array('/user/UserListAdvert'), 'visible'=>Yii::app()->user->checkAccess('user/UserListAdvert')),
                    array('label'=>'Только пользователи', 'url'=>array('/user/UserListUser'), 'visible'=>Yii::app()->user->checkAccess('user/UserListUser')),
                    array('label' => 'Все пользователи', 'url'=>array('/user/UserList'), 'visible'=>Yii::app()->user->checkAccess('user/UserList')),
                    array('label'=>'Создать пользователя', 'url'=>array('/user/UserAdd'), 'visible'=>Yii::app()->user->checkAccess('user/UserAdd')),
                    /*array('label'=>'Создать премиум', 'url'=>array('/User/UserPremiumAdd')),*/
                )),
            array('label' => 'Файлы', 'url'=>array('/filesmanager/FilesManager'), 'visible'=>Yii::app()->user->checkAccess('filesmanager/FilesManager') || Yii::app()->user->checkAccess('filesmanager/FilesPackageDelete') || Yii::app()->user->checkAccess('filesmanager/FilesDelete') || Yii::app()->user->checkAccess('filesmanager/MainStat'),
                'items'=>array(
                    array('label' => Yii::t('filesmanager_filesmanager', 'PAGE_TITLE'), 'url'=>array('/filesmanager/FilesManager'), 'visible'=>Yii::app()->user->checkAccess('filesmanager/FilesManager')),
                    array('label'=>'Пакетное удаление файлов', 'url'=>array('/filesmanager/FilesPackageDelete'), 'visible'=>Yii::app()->user->checkAccess('filesmanager/FilesPackageDelete')),
                    array('label'=>'Удаленные файлы', 'url'=>array('/filesmanager/FilesDelete'), 'visible'=>Yii::app()->user->checkAccess('filesmanager/FilesDelete')),
                    array('label'=>'Общая стата', 'url'=>array('/filesmanager/MainStat'), 'visible'=>Yii::app()->user->checkAccess('filesmanager/MainStat')),
                )),
            array('label'=>'Выплаты', 'url'=>array('/payment/Payment'), 'visible'=>Yii::app()->user->checkAccess('payment/Payment') || Yii::app()->user->checkAccess('payment/PaymentStat') || Yii::app()->user->checkAccess('payment/Penalty') || Yii::app()->user->checkAccess('payment/Compensation'),
                'items'=>array(
                    array('label'=>'Выплаты', 'url'=>array('/payment/Payment'), 'visible'=>Yii::app()->user->checkAccess('payment/Payment')),
                    array('label'=>'Статистика выплат', 'url'=>array('/payment/PaymentStat'), 'visible'=>Yii::app()->user->checkAccess('payment/PaymentStat')),
                    array('label'=>'Штрафы', 'url'=>array('/payment/Penalty'), 'visible'=>Yii::app()->user->checkAccess('payment/Penalty')),
                    array('label'=>'Компенсации', 'url'=>array('/payment/Compensation'), 'visible'=>Yii::app()->user->checkAccess('payment/Compensation')),
                )),
            array('label'=>'Настройки', 'url'=>array('/settings/SettingsTariffs'), 'visible'=>Yii::app()->user->checkAccess('settings/SettingsTariffs') || Yii::app()->user->checkAccess('settings/ClearCache') || Yii::app()->user->checkAccess('settings/EmailTemplates') || Yii::app()->user->checkAccess('settings/TechnicalPages') || Yii::app()->user->checkAccess('settings/download') || Yii::app()->user->checkAccess('settings/upload') || Yii::app()->user->checkAccess('settings/remotedl') || Yii::app()->user->checkAccess('settings/ApcMonitoring'),
                'items'=>array(
                    array('label'=>'Очистить кеш', 'url'=>array('/settings/ClearCache'), 'visible'=>Yii::app()->user->checkAccess('settings/ClearCache')),
                    array('label'=>'Шаблоны писем', 'url'=>array('/settings/EmailTemplates'), 'visible'=>Yii::app()->user->checkAccess('settings/EmailTemplates')),
                    array('label'=>'Технические страницы', 'url'=>array('/settings/TechnicalPages'), 'visible'=>Yii::app()->user->checkAccess('settings/TechnicalPages')),
                    array('label'=>'Мониторинг APC', 'url'=>array('/settings/ApcMonitoring'), 'visible'=>Yii::app()->user->checkAccess('settings/ApcMonitoring')),
                )),
            array('label'=>'Промо', 'url'=>'#', 'visible'=>Yii::app()->user->checkAccess('banner/BannerList'),
                'items'=>array(
                    array('label'=>'Баннеры', 'url'=>array('/banner/BannerList'), 'visible'=>Yii::app()->user->checkAccess('banner/BannerList')),
                )),
            array('label'=>'Антифрод', 'url'=>array('/antifrod/AntifrodList'), 'visible'=>Yii::app()->user->checkAccess('antifrod/AntifrodList') || Yii::app()->user->checkAccess('antifrod/WhiteList') || Yii::app()->user->checkAccess('antifrod/Settings'),
                'items'=>array(
                    array('label'=>'Доверенные юзеры', 'url'=>array('/antifrod/WhiteList'), 'visible'=>Yii::app()->user->checkAccess('antifrod/WhiteList')),
                    array('label'=>'Настройки', 'url'=>array('/antifrod/Settings'), 'visible'=>Yii::app()->user->checkAccess('antifrod/Settings')),
                )),
            array('label'=>'Новости', 'url'=>array('/News/newslist'), 'visible'=>Yii::app()->user->checkAccess('news/NewsList')),
            array('label'=>'Доступы', 'url'=>array('/admin/AdminList'), 'visible'=>Yii::app()->user->checkAccess('admin/AdminList') || Yii::app()->user->checkAccess('admin/AdminGroup') || Yii::app()->user->checkAccess('admin/AdminAction'),
                'items'=>array(
                    array('label'=>'Список пользователей админки', 'url'=>array('/admin/AdminList'), 'visible'=>Yii::app()->user->checkAccess('admin/AdminList')),
                    array('label'=>'Список групп', 'url'=>array('/admin/AdminGroup'), 'visible'=>Yii::app()->user->checkAccess('admin/AdminGroup')),
                    array('label'=>'Журнал действий пользователей админки', 'url'=>array('/admin/AdminAction'), 'visible'=>Yii::app()->user->checkAccess('admin/AdminAction')),
                )),
        ),
    )); ?>
    </div><!-- mainmenu -->

    <?php if(isset($this->breadcrumbs)):?>
        <?php $this->widget('zii.widgets.CBreadcrumbs', array(
        'links'=>$this->breadcrumbs,
    )); ?><!-- breadcrumbs -->
    <?php endif?>
    <div id="content">
        <br>
        <?php echo $content; ?>
    </div>
    <div class="clear"></div>
    <div id="footer">
        Текущее время: <?php echo date('Y-m-d H:i'); ?> <br/>
        Copyright &copy; <?php echo date('Y'); ?> Rapidgator.net<br/>
        All Rights Reserved.<br/>
        <?php echo Yii::powered(); ?>
    </div><!-- footer -->

</div><!-- page -->
<script type="text/javascript">
    $(document).ready(function() {
        div_height = $('body').height();
        $('body').css({height:div_height});
    });
</script>
</body>
</html>